<%@page contentType="text/html; charset=UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%String contextPath=request.getContextPath();%>
<script type="text/javascript" src="<%=contextPath%>/js/common/PageCommon.js"></script>

<div class="paging_area">
	<ul class="paging_lay">
		<li class="paging_01">

			<table><tr>
			<td class="pre_01">
			<c:if test="${pageNavi.currentPage-10>=1}">
				<a href="#" onclick="javascript:goMoveList('<c:out value="${pageNavi.pageGroupStart -1}"/>', '<c:out value="${pageNavi.rowsPerPage}"/>');window.event.returnValue=false"><strong>PRE</strong></a>
			</c:if>
			<c:if test="${pageNavi.currentPage-10< 1}">
			PRE
			</c:if>
			</td>
			
			<c:forEach var="idx" begin="${pageNavi.pageGroupStart}" end="${pageNavi.pageGroupEnd}">
				<c:if test="${idx==pageNavi.currentPage}">
					<td><a href="#" class="choice"><c:out value="${idx}"/></a></td>
				</c:if>
				<c:if test="${idx!=pageNavi.currentPage}">
					<td><a href="#" onclick="goMoveList('<c:out value="${idx}"/>','<c:out value="${pageNavi.rowsPerPage}"/>');window.event.returnValue=false" class="page"><c:out value="${idx}"/></a></td>
				</c:if>
			</c:forEach>
			
			<td class="next_01">
			<c:if test="${pageNavi.pageGroupStart+10<=pageNavi.pageTotal}">
				<a href="#" onclick="javascript:goMoveList('<c:out value="${pageNavi.pageGroupStart+10 }"/>','<c:out value="${pageNavi.rowsPerPage}"/>');window.event.returnValue=false"><strong>NEXT</strong></a>
			</c:if>
			<c:if test="${pageNavi.pageGroupStart+10>pageNavi.pageTotal}">
				NEXT
			</c:if>
			</td>
			</tr></table>

		</li>
	</ul>				
</div>


<form name="pageNaviForm" method="post" style="display:none">
  	<input type="hidden" id="currentPage" name="currentPage" value="<c:out value="${pageNavi.currentPage}"/>" >
  	<input type="hidden" name="rowsPerPage" value="<c:out value="${pageNavi.rowsPerPage}"/>">
</form>
<script>

if(pagingProperty && pagingProperty.searchForm && pagingProperty.searchForm.elements) {
  for(var i = 0; i < pagingProperty.searchForm.elements.length; i++) {
   var inputTag = document.createElement("INPUT");
   inputTag.type = "hidden";
   if(pagingProperty.searchForm.elements[i].type == "radio"){
    if(pagingProperty.searchForm.elements[i].checked == true){
     inputTag.name = pagingProperty.searchForm.elements[i].name;
     inputTag.value = pagingProperty.searchForm.elements[i].value;
     document.pageNaviForm.appendChild(inputTag);    
    }
   }else if(pagingProperty.searchForm.elements[i].type == "checkbox"){
    if(pagingProperty.searchForm.elements[i].checked == true){
     inputTag.name = pagingProperty.searchForm.elements[i].name;
     inputTag.value = pagingProperty.searchForm.elements[i].value;
     document.pageNaviForm.appendChild(inputTag);    
    }    
   }else{
    inputTag.name = pagingProperty.searchForm.elements[i].name;
    inputTag.value = pagingProperty.searchForm.elements[i].value;
    document.pageNaviForm.appendChild(inputTag);
   }
  } 
 }
</script>	
